package pATT.profilingAlgorithm.PersonalSearcher;


import java.io.Serializable;

public class Reference implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String url;
	private String title;
	private String description;
	private String searchEngine;
	private String category;
	private double percentage;

	public Reference(String t,String d){
		title=t.trim();
		description=d.trim();
	}

	public Reference(String t, double p){
		if (t==null)
			title = "";
		else
			title=t.trim();
		percentage=p;
	}

	public Reference(String u,String t,String se){
		url=u.trim();
		title=t.trim();
		searchEngine=se.trim();
	}

	public Reference(){
		url=new String();
		title=new String();
	}

	public String getURL(){
		return url;
	}

	public void setURL(String u){
		url=u.trim();
	}

	public double getPercentage(){
		return percentage;
	}

	public void setPercentage(double d){
		percentage = d;
	}

	public String getTitle(){
		return title;
	}

	public void setTitle(String t){
		title=t.trim();
	}

	public String getSE(){
		return searchEngine;
	}

	public void setSE(String se){
		searchEngine=se.trim();
	}

	public String getCategory(){
		return category;
	}

	public void setCategory(String cat){
		category=cat;
	}
	
	public String getDescription(){
		return description;
	}

	public void setDescription(String desc){
		description=desc.trim();
	}

	public String toString(){
		if (category!=null)
			return url+"|"+title+"|"+searchEngine+"|"+description+"|"+category;
		else
			return url+"|"+title+"|"+searchEngine+"|"+description;
	}

	public boolean equals(Reference ref){
			return url.equals((ref.getURL()).trim());
	}
}
